function include_js(url, encoding, callback){
	var head = document.getElementsByTagName('head')[0];
	var script = document.createElement('script');
	script.src = url;
	if(typeof encoding === 'string'){
		script.charset = encoding;
	}else if(!callback){
		callback = encoding;
	}
	var done = false;
	// ie supports onreadystatechange, while other browsers
	// support onload
	script.onload = script.onreadystatechange = function(){
		if( !done && (!this.readyState ||
				this.readyState == 'loaded' ||
				this.readyState == 'complete')){
			if(toString.call(callback) === '[object Function]'){
				callback()
			}
		}
	}
}
